home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.7 KB | 54 lines | [TEXT/GEOL] |
- Item 0269247 24-Aug-90 18:13PDT
-
- From: D3932 Ritchie, Clifford,PRT
-
- To: ROSENSTEIN1 Rosenstein, Larry
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Re: Re: Multiple Inheritance
-
- Being an Eiffel user, I must set the record straight for Mr. Rosenstein.
-
- The Eiffel class library contains three classes related to stacks: STACK,
- FIXED_STACK, and LIST_STACK. STACK is a deferred class (abstract) which
- describes the notion of a stack without commitment to its particular underlying
- representation. FIXED_STACK is a STACK represented as an ARRAY. And of course
- LIST_STACK implements stacks as linked lists.
-
- In Eiffel we are not confined as to how the stack has to be represented. If
- for example, say, I wanted a sorted stack: all I do is create a class
- SORTED_STACK, and make it inherit from STACK and SORTED_LIST. Voila! A stack
- that's implemented as a sorted link list. Hey man, that's power! Try to do that
- in Object Pascal. By the way, this is only an example, by definition, ordering
- a stack is not a stack. A stack must be LIFO or FIFO.
-
- Just for fun, the actual inheritance of FIXED_STACK is:
-
- ARRAY[T]
- INDEXABLE[T,INTEGER]
- INDIRECT[T]
- BASIC_ROUT
- STACK[T]
- DISPENSER[T]
-
- The [T]'s stuff indicate a parameterized classes, which is how Eiffel
- implements the concept of genericity.
-
- I don't understand why you say FIXED_STACK does not export any of ARRAY's
- features. I count four of them being exported by ARRAY in the actual code.
- You don't want to export them all, otherwise you'll try to work with it as an
- array and not a stack.
-
- I hope this makes things clearer.
-
- Vive Eiffel!
- --Cliff
-
-
-
-
-
-
-
-